﻿<%@ Page Language="C#" MasterPageFile="~/admintractor/admin.master" AutoEventWireup="true" CodeFile="Article.aspx.cs" Inherits="admintractor_Article" Title="Danh sách bài viết" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div id="title">Danh sách bài viết </div>
					<div id="view">
						
					    <table style="width: 100%">
                            <tr>
                                <td>
                                    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                                        Text="Thêm mới" />
                                    &nbsp;&nbsp;&nbsp;Khối thông tin:&nbsp;
                                    <asp:DropDownList ID="DropDownList1" runat="server" Width="250px" 
                                        AutoPostBack="True" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lb_Error" runat="server" ForeColor="Red"></asp:Label></td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                AutoGenerateColumns="False" onpageindexchanging="GridView1_PageIndexChanging" 
                                        PageSize="12" >
                                <Columns>
                                    <asp:BoundField HeaderText="Tiêu đề bài viết" DataField="_name" />
                                    
                                    <asp:TemplateField HeaderText="Loại bài">
                                        <ItemStyle Width="170px" />
                                        <ItemTemplate>
                                       <%#this.viewCategory((int)(DataBinder.Eval(Container, "DataItem._categoryID")))%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField HeaderText="Lượt xem" DataField="_visited">
                                        <ItemStyle Width="40px" />
                                    </asp:BoundField>
                                    <asp:TemplateField HeaderText="Trạng thái">
                                        <ItemStyle Width="80px" />
                                        <ItemTemplate>
                                       <%#this.view((string)(DataBinder.Eval(Container, "DataItem._status")))%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Thao tác" >
                                    <ItemStyle Width="80px" />
                                    <ItemTemplate>
                                                    <table style="width: 100%">
                                                        <tr>
                                                            <td>
                                                                <asp:LinkButton ID="lbEdit" runat="server" Text="Sửa" CommandName="Select" 
                                                                    CommandArgument='<%# Eval("_articlesID","{0}") %>' onclick="lbEdit_Click" ></asp:LinkButton>
                                                            </td>
                                                            <td>
                                                                <asp:LinkButton ID="lbDelete" runat="server" Text="Xóa" CommandArgument='<%# Eval("_articlesID","{0}") %>'
                                                                 CommandName="Select"  OnClientClick="return confirm('Are you sure?');" onclick="lbDelete_Click" 
                                                                ></asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                            
                                </td>
                            </tr>
                        </table>
						
					</div>
</asp:Content>

